
export const setGpsInfoCmd = ( location)=>{
    let time = new Date().getTime()/ 1000
    let zone = - new Date().getTimezoneOffset() / 60
    let cmd = `setGpsInfo ${location.longitude.toFixed(4)} ${location.latitude.toFixed(4)} ${location.altitude.toFixed(4)} ${time.toFixed(0)}  ${zone} seq[10]\r\n`

    return cmd
}

export const addTleInfoCmd = (id,tle1,tle2)=>{
    return `addTleInfo ${id} ${tle1},${tle2} seq[30]\r\n`
}

export const addSatMsgCmd = (isSos,tel,message)=>{
    let type = isSos ? 4 : 1
    return `addSatMsg   ${type}  ${tel} ${message}  seq[20]\r\n`
}

export const getSatMsgCmd = (no)=>{
    return `getSatMsg  ${no} seq[21]\r\n`
}

export const delSatMsgCmd = (no)=>{
    return `delSatMsg   ${no} seq[22]\r\n`
}

export const setTemplateCmd = (message,no)=>{

    return `setTemplate ${no + 1} ${message} seq[30]\r\n`
}

